package com.longshen.dubbo.api.exception;

import com.longshen.dubbo.api.base.ErrorCode;

import lombok.Data;

@Data
public class DubboApiException extends RuntimeException {/** 
	* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
	*/ 
	private static final long serialVersionUID = 541113483924653336L;
	
	

	private String errorCode;
	private String message;
	
	
	 public DubboApiException(String errorCode, Throwable cause) {
		    super(errorCode, cause);
		    this.errorCode = errorCode;
		  }
	 
	 public DubboApiException(String errorCode, String message,Throwable cause) {
		    super(errorCode, cause);
		    this.errorCode = errorCode;
		    this.message = message;
		  }
	 
	 public DubboApiException(ErrorCode  error) {
		    super(error.getCode(), null);
		    this.errorCode = error.getCode();
		    this.message = error.getDesc();
		  }


}
